package com.sitanyun.merchant.guide.frament.view.activity;

import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sitanyun.merchant.guide.R;
import com.sitanyun.merchant.guide.base.BaseActivity;
import com.sitanyun.merchant.guide.weiht.StepViews;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 设置密码
 */
public class UpdatePswdActivity extends BaseActivity {

    @BindView(R.id.sv_step)
    StepViews svStep;
    @BindView(R.id.et_forget_phone)
    EditText etForgetPhone;
    @BindView(R.id.phone_message)
    TextView phoneMessage;
    @BindView(R.id.phone_next)
    TextView phoneNext;
    @BindView(R.id.ll_forget_one)
    LinearLayout llForgetOne;
    @BindView(R.id.et_fogethree_phone)
    EditText etFogethreePhone;
    @BindView(R.id.foget_phone_msgthree)
    TextView fogetPhoneMsgthree;
    @BindView(R.id.et_fogethree_password)
    EditText etFogethreePassword;
    @BindView(R.id.paswd_layout)
    LinearLayout paswdLayout;
    @BindView(R.id.foget_pass_msgthree)
    TextView fogetPassMsgthree;
    @BindView(R.id.phone_next_three)
    TextView phoneNextThree;
    @BindView(R.id.ll_forget_three)
    LinearLayout llForgetThree;
    @BindView(R.id.showdown)
    TextView showdown;
    @BindView(R.id.tv_foget_last)
    TextView tvFogetLast;
    @BindView(R.id.ll_foget_for)
    LinearLayout llFogetFor;

    @Override
    public int getLayoutId() {
        return R.layout.activity_update_pswd;
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        setFindViewById(true);
        setTitleStr("修改密码");
        //自动弹出键盘问题解决
        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
        }
    }

    @Override
    public void initView() {
        svStep.setProgress(1, 3);
        List<String> list = new ArrayList<>();
        list.add("密码确认");
        list.add("重置密码");
        list.add("重置密码");
        svStep.setTitles(list);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick({R.id.phone_next, R.id.phone_next_three, R.id.tv_foget_last})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.phone_next:
                String phone = etForgetPhone.getText().toString().trim();
                if (phone.isEmpty()) {
                   phoneMessage.setText("请输入初始密码");
                    return;
                }
              initone();

                break;
            case R.id.phone_next_three:
                break;
            case R.id.tv_foget_last:
                break;
        }
    }

   //验证密码
    private void initone() {

    }
}
